#ifndef _APM_
#define _APM_

#define APM_SWINT 0x15
#define APM_INST 0x5300
#define APM_CONNECTRM 0x5301
#define APM_C16PM 0x5302
#define APM_DISCONNECT 0x5304
#define CPU_IDLE 0x5305
#define CPU_BUSY 0x5306
#define APM_PWRSTATE 0x5307
#define APM_ED 0x5308
#define RESTORE_DEF 0x5309
#define APM_DRVVER 0x530e

#define dev_idBIOS 0
#define dev_idALL 1
#define dev_idDISPLAY 0x1ff
#define dev_idSECSTR 0x2ff
#define dev_idPARALLEL 0x3ff
#define dev_idSERIAL 0x4ff
#define dev_idNETADAP 0x5ff
#define dev_idPCMCIA 0x6ff

#define stateREADY 0
#define stateSTANDBY 1
#define stateSUSPEND 2
#define stateOFF 3
struct apm_inst	{
	unsigned char majv;
	unsigned char minv;
	unsigned short flags;
	unsigned char errc;
};

typedef struct		{
	int (*get_apm_info)();
	int (*apm_poweroff)();
	void *device_struct;
}apm_dev;

#define READ_GET_APM_INFO 0x101
#define WRITE_CONNECT_RM 0x101
#define WRITE_DISCONNECT 0x102
#define WRITE_CPU_IDLE 0x103
#define WRITE_CPU_BUSY 0x104
#define WRITE_SET_POWER_STATE 0x105
#define WRITE_ENABLE_APM 0x106
#define WRITE_DISABLE_APM 0x107
#define WRITE_RESTORE_DEF 0x108
#define WRITE_DRIVER_VER 0x109
#define WRITE_APM_POWEROFF 0x110

#endif
